/*
 * @Author: wangqf
 * @LastEditors: wangqf
 * @email: wangqf19@189.cn
 * @Date: 2021-04-22 20:33:11
 * @LastEditTime: 2021-04-23 08:48:16
 * @Description: 
 * @FilePath: \myDevelopment\nodejs\node_server@wangqf\src\server.js
 */
/** 
 * node_server
 */

// config
const config = {
  host: 'localhost',
  port: 3000,
  url: '/api'
} 

// express
const express = require('express')
const server = express();
server.use(express.json());
server.use(express.urlencoded({ extended: true }));

// router
const router = require('./routes/index');
server.use(config.url, router);

// server
server.listen(config.port, () => {
  console.log('create server success, listen http://' + config.host + ':' + config.port)
})
